package com.kfm.base.thread.day03;

import java.time.LocalDateTime;

public class Demo14 {

    public static void main(String[] args) {
//        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(2, 10, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(20));
        Thread daemon = new Thread(() -> {
            while (!Thread.currentThread().isInterrupted()){
                System.out.println(LocalDateTime.now());
            }
        });
        // 守护线程
        daemon.setDaemon(true);

        daemon.start();

        try {
            Thread.sleep(10);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        System.out.println("--------------------------end-----------------------------");

    }
}
